(function(cjs, as){
	(as.InputNumber=function(){
		this.Container_constructor();
		var self=this;
		this._radius=6;
		this._value=3;
		this._min=3;
		this._step=1;
		
		var shape0=new cjs.Shape();
		shape0.graphics.beginFill("#000");
		shape0.graphics.drawRoundRect(0,0,100,30,this._radius);
		this.addChild(shape0);
		
		var shape1=new cjs.Shape();
		shape1.graphics.beginFill("#fff");
		shape1.graphics.drawRoundRectComplex(1,1,25,28,this._radius-1,0,0,this._radius-1);
		shape1.graphics.drawRect(27,1,46,28);
		shape1.graphics.drawRoundRectComplex(74,1,25,28,0,this._radius-1,this._radius-1,0);
		this.addChild(shape1);
		
		var shape2=new cjs.Shape();
		shape2.graphics.beginFill("#000");
		shape2.graphics.drawRect(7+1,15,11,1);
		shape2.graphics.drawRect(74+7,15,11,1);
		shape2.graphics.drawRect(12+74,10,1,11);
		this.addChild(shape2);
		
		var txt0=new cjs.Text(this._value,"20px Arial","black");
		txt0.setTransform(27+46/2,7);
		txt0.lineWidth=46;
		txt0.textAlign='center';
		txt0.parent=this;
		this.addChild(txt0);
		
		this.on('mousedown',function(e){
			//console.log(e.localX);
			if(e.localX<27&&self._value>self._min){
				this._value--;
				sendEvent();
			}else if(e.localX>74){
				this._value++;
				sendEvent();
			}
		},null,false);
		this.mouseChildren=false;
		
		function sendEvent(){
			var evt=new cjs.Event('change');
			evt.data={value:self._value};
			self.dispatchEvent(evt);
		}
		
		this.reset=function(){
			txt0.text=self._value;
		};
	});
	var p=cjs.extend(as.InputNumber,cjs.Container);
	//value属性
	p._get_value=function(){
		return this._value;
	};
	p._set_value=function(value){
		this._value=value;
		this.reset();
	};
	try{
		Object.defineProperties(p,{
			value:{get:p._get_value,set:p._set_value}
		});
	} catch (e) {}
	//min属性
	p._get_min=function(){
		return this._min;
	};
	p._set_min=function(value){
		this._min=value;
		//this.reset();
	};
	try{
		Object.defineProperties(p,{
			min:{get:p._get_min,set:p._set_min}
		});
	} catch (e) {}
	
	as.InputNumber = cjs.promote(as.InputNumber, "Container");
})(createjs = createjs||{}, ascainiao = ascainiao||{});
var createjs, ascainiao;